31800: validate Incorporation Application share structure fields#4036
Open
loneil wants to merge 10 commits intobcgov:mainfrom
Open
31800: validate Incorporation Application share structure fields#4036loneil wants to merge 10 commits intobcgov:mainfrom
loneil wants to merge 10 commits intobcgov:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens validation rules for share structures, enforcing consistent naming for share classes and series and adding comprehensive unit tests around these rules.
Changes:
- Introduced
EXCLUDED_WORDS_FOR_CLASSandEXCLUDED_WORDS_FOR_SERIESconstants and extendedvalidate_shares/validate_seriesto enforce a" Shares"suffix and to reject reserved words in class and series names. - Ensured series-level validations (max shares, rights/restrictions, duplicate names) now also include suffix and reserved-word checks while maintaining existing behavior.
- Added extensive unit tests in
test_common_validations.pyfor share-class and series names, as well as for end-to-endvalidate_share_structurebehavior over various valid and invalid share structures.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| legal-api/src/legal_api/services/filings/validations/common_validations.py | Adds reserved-word and suffix validations for share class and series names, and exposes exclusion word lists as constants used across filings. |
| legal-api/tests/unit/services/filings/validations/test_common_validations.py | Adds parameterized tests covering class/series name suffix rules, reserved words, whitespace/emptiness, duplication, and full share-structure validation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
legal-api/src/legal_api/services/filings/validations/common_validations.py
Outdated
Show resolved
Hide resolved
legal-api/src/legal_api/services/filings/validations/common_validations.py
Outdated
Show resolved
Hide resolved
a6477dd to
3895c05
Compare
loneil
commented
Feb 3, 2026
| ) | ||
|
|
||
|
|
||
| def has_at_least_one_share_class(filing_json, filing_type) -> Optional[str]: # pylint: disable=too-many-branches |
Collaborator
Author
There was a problem hiding this comment.
Found this function was unused anywhere in the app (validation was done elsewhere)
Signed-off-by: Lucas <lucasoneil@gmail.com>
Signed-off-by: Lucas <lucasoneil@gmail.com>
Signed-off-by: Lucas <lucasoneil@gmail.com>
Signed-off-by: Lucas <lucasoneil@gmail.com>
Signed-off-by: Lucas <lucasoneil@gmail.com>
Signed-off-by: Lucas <lucasoneil@gmail.com>
Signed-off-by: Lucas <lucasoneil@gmail.com>
2762cfb to
f1fd9f7
Compare
Signed-off-by: Lucas <lucasoneil@gmail.com>
Signed-off-by: Lucas <lucasoneil@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
legal-api/src/legal_api/services/filings/validations/common_validations.py
Outdated
Show resolved
Hide resolved
legal-api/src/legal_api/services/filings/validations/common_validations.py
Outdated
Show resolved
Hide resolved
legal-api/tests/unit/services/filings/validations/test_amalgamation_application.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Lucas <lucasoneil@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #: /bcgov/entity#31800
Description of changes:
Needs 31800: Example Data - Share Structure naming business-schemas#202 merged so unit tests can be accomodated
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).